package com.nacrtstudio.webgiftshop.pages;

import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.Request;

import com.nacrtstudio.webgiftshop.facade.Controller;

public class PaymentMethod {
	@Inject
	private Request request;
	public void onActivate() {
		try {
			if (controller.getRequest()==null) {
	    		controller.setRequest(request);
			}
		} catch (Exception e) {
		}
	}

	@Inject
	@Property
	private Controller controller;
	@Component(id = "paymentForm")
	private Form paymentForm;
	
	public Object onSuccessFromPaymentForm(){
		controller.updateUser(controller.getLoggedUser());
		return UserProfile.class;
	}
}
